home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / dc174v11.zip / RSB4DROP.MRG < prev    next >
Text File  |  1992-10-03  |  4KB  |  95 lines

  1. * ------------[ BLED merge (c) Ken Goosens ]-------------
  2. * Merge this against RBBSSUB4.BAS to produce RBBSSUB4.NEW
  3. * RBBSSUB4.BAS:  Date 6-20-1992  Size 120885 bytes
  4. *          DROP174 (c) 1992 by Richie Molinelli
  5. * ------------[ Created 10-03-1992 22:14:26 ]------------
  6. * REPLACING old line(s) by new
  7. 58250 ' $SUBTITLE: 'SmartText - smart text substitution'
  8. ' $PAGE
  9. '
  10. '  NAME    -- SmartText   (WRITTEN BY DOUG AZZARITO)
  11. '
  12. '  INPUTS  -- StringWork$        string to scan for Smart Text
  13. '             CRFound            Does this line contain a CR?
  14. '             ZSmartTextCode     Smart Text control code
  15. '
  16. '  OUTPUTS -- StringWork$        Input string with Smart replaced
  17. '
  18. '  PURPOSE -- Smart Text allows control strings in text files
  19. '             to be replaced at runtime with user info or other
  20. '             data.  The Smart Text control code is a 1-byte
  21. '             code (configurable) with a 2-byte action code.
  22. '
  23.       SUB SmartText (StringWork$, CRFound, OverStrike) STATIC
  24.       IF SmartCarry$<>"" THEN _
  25.          StringWork$ = SmartCarry$+StringWork$
  26.       Index = INSTR(StringWork$, ZSmartTextCode$)
  27.       WHILE Index > 0 AND Index < LEN(StringWork$)-1
  28.          IF INSTR(MID$(StringWork$, Index+1,2)," ") THEN _
  29.             SmartAct = 0 _
  30.          ELSE _
  31.             SmartAct = INSTR(ZSmartTable$, MID$(StringWork$, Index+1, 2))
  32.          IF SmartAct = 0 THEN _
  33.             WasI = 1 : _
  34.             GOTO 58254
  35.          SmartAct = (SmartAct+2)/3
  36.          ON SmartAct GOSUB 58260, 58261, 58262, 58263, 58264, 58265, _
  37.                            58266, 58267, 58268, 58269, 58270, _
  38.                            58271, 58272, 58273, 58274, 58275, _
  39.                            58276, 58277, 58278, 58279, 58280, _
  40.                            58281, 58282, 58283, 58284, 58285, _
  41.                            58286, 58287, 58289, 58290, 58291, _
  42. * ------[ first line different ]------
  43.                            58292, 58293, 58294, 58295, 58255         ' DROP174
  44.          GOSUB 58256
  45.          WasI = LEN(SmartHold$)
  46.          ReplaceLen = 3
  47.          IF OverStrike OR Overlay THEN _
  48.             IF WasI > 2 THEN _
  49.                ReplaceLen = WasI _
  50.             ELSE _
  51.                SmartHold$ = SmartHold$ + SPACE$(3 - WasI)
  52.          StringWork$ = LEFT$(StringWork$, Index-1) + SmartHold$ + _
  53.                        MID$(StringWork$,Index+ReplaceLen)
  54. 58254    Index = INSTR(Index+WasI, StringWork$, ZSmartTextCode$)
  55.       WEND
  56.       IF Index AND (Index > LEN(StringWork$)-2) AND NOT CRFound THEN _
  57.          SmartCarry$ = MID$(StringWork$,Index) : _
  58.          StringWork$ = LEFT$(StringWork$,Index-1) : _
  59.       ELSE _
  60.          SmartCarry$ = ""
  61.       EXIT SUB
  62. * INSERTING new line(s)
  63. 58255 SmartHold$ = STR$(ZDropTimes)   ' CD Carrier Drops             ' DROP174
  64.       CALL Trim (SmartHold$)                                         ' DROP174
  65.       RETURN                                                         ' DROP174
  66. 58256 IF TrimSmart THEN _
  67.          CALL Trim (SmartHold$)
  68.       RETURN
  69. * REPLACING old line(s) by new
  70. 64645 ' * sets new user defaults
  71.       ' * formerly 12900 of rbbs-pc.bas
  72.       SUB SetNewUserDef STATIC
  73.       LSET ZUserName$ = ZActiveUserName$
  74.       LSET ZUserOption$ = MKI$(0) + _
  75.                            MKI$(0) + _
  76.                            " 0" + _
  77.                            MKI$(64) + _
  78.                            MKI$(16) + _
  79.                            MKI$(0) + _
  80.                            CHR$(23) + _
  81.                            ZDefaultEchoer$
  82.       LSET ZUserDnlds$ = MKI$(0)
  83.       LSET ZUserUplds$ = MKI$(0)
  84.       IF ZEnforceRatios THEN _
  85.          LSET ZTodayDl$ = MKS$(0) : _
  86.          LSET ZTodayBytes$ = MKS$(0) : _
  87.          LSET ZDlBytes$ = MKS$(0) : _
  88.          LSET ZULBytes$ = MKS$(0)
  89.       LSET ZSecLevel$ = MKI$(ZTempSecLevel)
  90.       LSET ZElapsedTime$ = MKI$(0)
  91. * ------[ first line different ]------
  92.       LSET ZDropTimes$ = CHR$(0)                                     ' DROP174
  93.       LSET ZBankTime$ = CHR$(0)
  94.       END SUB
  95.